/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dca.sistemascontrole.sinais;

import java.util.Date;

/**
 *
 * @author Rafael
 */
public class Senoidal extends Sinal {

    public Senoidal(float periodo, float amplitude, float frequencia, float offset) {
        super(periodo, amplitude, frequencia, offset);
    }

    @Override
    protected float getValue(long t) {
        float deltaT = (t - t0) % periodo;
        float anguloRadianos = (float) ((deltaT / periodo) * 2 * Math.PI);

        return (float) Math.sin(anguloRadianos) * amplitude / 2;
    }
}
